package org.openoa.engine.bpmnconf.adp.bpmnnodeadp;

import org.openoa.base.constant.enums.NodePropertyEnum;
import org.openoa.base.vo.BpmnNodeVo;
import org.openoa.base.vo.PersonnelRuleVO;
import org.openoa.engine.bpmnconf.constant.enus.BpmnNodeAdpConfEnum;
import org.springframework.stereotype.Service;

@Service
public class NodePropertyCollegeSecretaryAdp implements BpmnNodeAdaptor {

    // 设计器加载节点：空实现（无需查人员）
    @Override
    public void formatToBpmnNodeVo(BpmnNodeVo bpmnNodeVo) {}

    // 设计器保存节点：空实现（无需存人员）
    @Override
    public void editBpmnNode(BpmnNodeVo bpmnNodeVo) {}

    // 向前端返回“学院研究生秘书”的配置（显示选项用）
    @Override
    public PersonnelRuleVO formaFieldAttributeInfoVO() {
        PersonnelRuleVO vo = new PersonnelRuleVO();
        NodePropertyEnum collegeSecretaryEnum = NodePropertyEnum.NODE_PROPERTY_COLLEGE_SECRETARY;
        vo.setNodeProperty(collegeSecretaryEnum.getCode()); // 25
        vo.setNodePropertyName(collegeSecretaryEnum.getDesc()); // 学院研究生秘书
        return vo;
    }

    // 绑定适配配置枚举（告诉系统这是处理学院秘书的适配器）
    @Override
    public void setSupportBusinessObjects() {
        addSupportBusinessObjects(BpmnNodeAdpConfEnum.ADP_CONF_NODE_PROPERTY_COLLEGE_SECRETARY);
    }
}
